package Runtime;

import java.io.IOException;

public class runtime {
    public static void main(String[] args) throws IOException {
        RunTime();
    }

    public static void RunTime() throws IOException {
        Runtime runtime = Runtime.getRuntime(); //获取当前运行环境对象
        System.out.println(runtime.availableProcessors());  //获取CPU线程
        System.out.println(runtime.maxMemory()); //获取VM最大内存
        System.out.println(runtime.freeMemory()); //获取VM剩余内存
        System.out.println(runtime.totalMemory()); //获取VM已使用内存
        runtime.exit(0); //停止虚拟机
    }
}
